﻿using Microsoft.SharePoint.Administration;
using System;
using System.Collections.Generic;

namespace IPS.SP2013.DiagnosticsProvider
{

    /// <summary>
    /// This class contains all required structs, enums and constants to be used by IPS.SP2013.DiagnosticsProvider
    /// </summary>
    public static class Constants
    {

        #region Structs

        /// <summary>
        /// Struct that represents a custom definition of a log category
        /// </summary>
        public struct CustomLogCategory
        {
            public uint Id;
            public string Name;
            public TraceSeverity TraceSeverity;
            public EventSeverity EventSeverity;
        }

        #endregion

        #region Log Provider

        /// <summary>
        /// Used by the custom log provider to define a diagnostics area name
        /// NOTE: specify your own value to indentify the log entries of your devs
        /// </summary>
        public static readonly string Diagnostics_Area_Name = "IPS";

        /// <summary>
        /// Enum that represents values of your custom logging events
        /// NOTE: each one identify an item in the "CustomLogCategories" dictionary
        /// </summary>
        public enum CategoryNames
        {
            Infomation = 0,
            Warning = 1,
            Error = 2,
            Success = 3
        }

        /// <summary>
        /// Dictionary that specify the custom definition of each log category
        /// NOTE: specify your own values and make sure to create the corresponding value
        /// in enum "CategoryNames"
        /// </summary>
        public static readonly Dictionary<int, CustomLogCategory> CustomLogCategories = new Dictionary<int, CustomLogCategory>()
        {
            {0, new CustomLogCategory () {Id = 0, Name = Enum.GetName(typeof(CategoryNames), CategoryNames.Infomation), TraceSeverity = TraceSeverity.Medium, EventSeverity= EventSeverity.Information } },
            {1, new CustomLogCategory () {Id = 0, Name= Enum.GetName(typeof(CategoryNames), CategoryNames.Warning), TraceSeverity = TraceSeverity.High, EventSeverity= EventSeverity.Warning } },
            {2, new CustomLogCategory () {Id = 0, Name= Enum.GetName(typeof(CategoryNames), CategoryNames.Error), TraceSeverity = TraceSeverity.Unexpected, EventSeverity= EventSeverity.Error } },
            {3, new CustomLogCategory () {Id = 0, Name= Enum.GetName(typeof(CategoryNames), CategoryNames.Success), TraceSeverity = TraceSeverity.Verbose, EventSeverity= EventSeverity.Verbose } }
        };

        #endregion

    }

}
